package dao.impl;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.PersistenceUnit;

import org.springframework.stereotype.Repository;

import pojo.Book;
import dao.BookDao;
@Repository
public class BookDaoImpl implements BookDao {
	@PersistenceContext(name="em")
	//@PersistenceUnit
	private EntityManager em;
	@Override
	public int addBook(Book b) {
		em.persist(b);
		return b.getId();
	}

}
